<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
  <title>Description of change_groupname</title>
  <meta name="keywords" content="change_groupname">
  <meta name="description" content="Changes the groupname for all objects in a group">
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <meta name="generator" content="m2html &copy; 2003 Guillaume Flandin">
  <meta name="robots" content="index, follow">
  <link type="text/css" rel="stylesheet" href="../m2html.css">
</head>
<body>
<a name="_top"></a>
<!-- menu.html . -->
<h1>change_groupname
</h1>

<h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>Changes the groupname for all objects in a group</strong></div>

<h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>function [subj] = change_groupname(subj,objtype,old_groupname,new_groupname) </strong></div>

<h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="fragment"><pre class="comment"> Changes the groupname for all objects in a group

 [SUBJ] = CHANGE_GROUPNAME(SUBJ,OBJTYPE,OLD_GROUPNAME,NEW_GROUPNAME)

 This goes through all the objects of a specific type, finds those
 with group_name OLD_GROUPNAME, and sets it instead to
 NEW_GROUP_NAME

 I think this is safe to do, but changes the name or group_name of
 an object are not recommended</pre></div>

<!-- crossreference -->
<h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
This function calls:
<ul style="list-style-image:url(../matlabicon.gif)">
<li><a href="find_group.html" class="code" title="function [matches] = find_group(subj,objtype,groupname)">find_group</a>	Returns a list of names of objects from this group</li><li><a href="set_objfield.html" class="code" title="function [subj] = set_objfield(subj,objtype,objname,fieldname,newval,varargin)">set_objfield</a>	Replace or add a field to an object</li></ul>
This function is called by:
<ul style="list-style-image:url(../matlabicon.gif)">
</ul>
<!-- crossreference -->


<h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="fragment"><pre>0001 <a name="_sub0" href="#_subfunctions" class="code">function [subj] = change_groupname(subj,objtype,old_groupname,new_groupname)</a>
0002 
0003 <span class="comment">% Changes the groupname for all objects in a group</span>
0004 <span class="comment">%</span>
0005 <span class="comment">% [SUBJ] = CHANGE_GROUPNAME(SUBJ,OBJTYPE,OLD_GROUPNAME,NEW_GROUPNAME)</span>
0006 <span class="comment">%</span>
0007 <span class="comment">% This goes through all the objects of a specific type, finds those</span>
0008 <span class="comment">% with group_name OLD_GROUPNAME, and sets it instead to</span>
0009 <span class="comment">% NEW_GROUP_NAME</span>
0010 <span class="comment">%</span>
0011 <span class="comment">% I think this is safe to do, but changes the name or group_name of</span>
0012 <span class="comment">% an object are not recommended</span>
0013 
0014 <span class="comment">% This is part of the Princeton MVPA toolbox, released under the</span>
0015 <span class="comment">% GPL. See http://www.csbmb.princeton.edu/mvpa for more</span>
0016 <span class="comment">% information.</span>
0017 
0018 
0019 <span class="keyword">if</span> nargin &lt; 4
0020   error(<span class="string">'I think you''ve forgotten to feed in all your arguments'</span>);
0021 <span class="keyword">end</span>
0022 
0023 <span class="keyword">if</span> ~nargout
0024   error(<span class="string">'Don''t forget to catch the subj structure that gets returned'</span>);
0025 <span class="keyword">end</span>
0026 
0027 members = <a href="find_group.html" class="code" title="function [matches] = find_group(subj,objtype,groupname)">find_group</a>(subj,objtype,old_groupname);
0028 
0029 <span class="keyword">for</span> m=1:length(members)
0030   subj = <a href="set_objfield.html" class="code" title="function [subj] = set_objfield(subj,objtype,objname,fieldname,newval,varargin)">set_objfield</a>(subj,objtype,members{m},<span class="string">'group_name'</span>,new_groupname);
0031 <span class="keyword">end</span> <span class="comment">% m members</span>
0032</pre></div>
<hr><address>Generated on Tue 06-Sep-2005 22:11:31 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" target="_parent">m2html</a></strong> &copy; 2003</address>
</body>
</html>